<?php 
header('Content-type:text/html;charset=utf8');
session_start();
session_unset();
session_destroy();

$str = <<<str
<script>
alert('退出成功');
location.href = "./index.php";
</script>
str;
echo $str;

